#!/usr/bin/env bash
host="192.168.8.67"
user="root"
serverPath="/data1/docker/projects/smart-audit/"
projectName="api-0.0.1-SNAPSHOT.jar"

git pull

echo "========================开始打包========================"
mvn clean install -pl common -DskipTests
mvn clean package -pl api -am -DskipTests
echo "========================结束打包========================"

echo "========================开始上传========================"
scp api/target/${projectName} ${user}@${host}:${serverPath}${projectName}
echo "========================结束上传========================"

echo "========================开始启动========================"
ssh ${user}@${host} "cd ${serverPath} && ./startup.sh"
echo "========================结束启动========================"